from typing import List


class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        j = 2
        for i in range(2, len(nums)):
            if nums[i] != nums[j - 2]:
                nums[j] = nums[i]
                j += 1
        print(nums)
        return j


if __name__ == "__main__":
    s = [1, 1, 1, 2, 2, 3]
    Solution().removeDuplicates(s)
    print(s)